﻿using System.Collections;
using System.Collections.Generic;

namespace SlickGridNet
{
	/// <summary>
	/// Collection of resources to include
	/// </summary>
	public class ResourcesCollection : IEnumerable<ResourceItem>
	{
		private readonly List<ResourceItem> _pathList;

		/// <summary>
		/// Initializes a new instance of the SlickGridNet.ResourceCollection class that is empty and has the default initial capacity.
		/// </summary>
		public ResourcesCollection()
		{
			_pathList = new List<ResourceItem>();
		}

		/// <summary>
		/// Adds the <paramref name="path"/> to the end of the Collection
		/// </summary>
		/// <param name="path"></param>
		public void Add(string path)
		{
			_pathList.Add(new ResourceItem(path));
		}

		/// <summary>
		/// Returns an enumerator that iterates through the collection.
		/// </summary>
		/// <returns>
		/// A <see cref="T:System.Collections.Generic.IEnumerator`1"/> that can be used to iterate through the collection.
		/// </returns>
		public IEnumerator<ResourceItem> GetEnumerator()
		{
			return _pathList.GetEnumerator();
		}

		/// <summary>
		/// Returns an enumerator that iterates through a collection.
		/// </summary>
		/// <returns>
		/// An <see cref="T:System.Collections.IEnumerator"/> object that can be used to iterate through the collection.
		/// </returns>
		IEnumerator IEnumerable.GetEnumerator()
		{
			return GetEnumerator();
		}
	}
}
